







[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Must be overridden to allow adding items to this collection.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public virtual void Add( T item ) |
Visual Basic (Declaration) |
---|
Public Overridable Sub Add ( _ item As T _ ) |
Visual C++ |
---|
public: virtual void Add ( T item ) |
Parameters
- item
- T
Item to be added to the collection.
Remarks
This method is not abstract, although derived classes should always override it. It is not abstract because some derived classes may wish to reimplement Add with a different return type (typically bool). In C#, this can be accomplished with code like the following:
![]() | |
---|---|
public class MyCollection<T>: CollectionBase<T>, ICollection<T> { public new bool Add(T item) { /* Add the item */ } void ICollection<T>.Add(T item) { Add(item); } } |
Exceptions
Exception | Condition |
---|---|
System..::NotImplementedException | Always throws this exception to indicated that the method must be overridden or re-implemented in the derived class. |
See Also
CollectionBase<(Of <T>)> Class
Wintellect.PowerCollections Namespace